//AnimalsTest.java
package com.ylaihui.oop1;

class Animals{
	private int legs;
	public void setLegs(int l){
		if(l <= 0 || l % 2 == 1)
			legs = 0;
		else
			legs = l;
	}
	public int getLegs(){
		return legs;
	}
}
public class AnimalsTest {
	public static void main(String[] args) {
		Animals a = new Animals();
		a.setLegs(-10);
		//System.out.println(a.legs);  // The field Animals.legs is not visible
		System.out.println(a.getLegs());
	}
}
